Dim doc
Set doc = application.ActiveDocument
ValidateServer(doc)
main
sub main()
	
	doc.ActiveView.DisplayControl.Global.MiscItems(4) = false
	doc.ActiveView.DisplayControl.Global.MiscItems(5) = false
	
	dim index	
	dim colorPatternObj
	set colorPatternObj = doc.activeView.DisplayControl.Global.ConductorLayerColor(1,0)
	index = colorPatternObj.index
	'msgbox index
	if index = 0 then
		index = 2
	else
		index = 0
	end if	
	
	dim i
	for i=1 to doc.layercount-1
		'msgbox i
		set colorPatternObj = doc.activeView.DisplayControl.Global.ConductorLayerColor(i,0)
		colorPatternObj.index = index
		colorPatternObj.Transparent = true 
		set doc.activeview.displaycontrol.Global.ConductorLayerColor(i,0) = colorPatternObj
		
		set colorPatternObj = doc.activeView.DisplayControl.Global.ConductorLayerColor(i,1)
		colorPatternObj.index = index
		colorPatternObj.Transparent = true 
		set doc.activeview.displaycontrol.Global.ConductorLayerColor(i,1) = colorPatternObj
	next	
end sub
'---------------------------------------
' Begin Validate Server Function
'---------------------------------------
Private Function ValidateServer(doc)    
    Dim key, licenseServer, licenseToken
    ' Ask Expedition抯 document for the key
    key = doc.Validate(0)
    ' Get license server
    Set licenseServer = CreateObject("MGCPCBAutomationLicensing.Application")
    ' Ask the license server for the license token
    licenseToken = licenseServer.GetToken(key)
    ' Release license server
    Set licenseServer = Nothing
    ' Turn off error messages.  Validate may fail if the token is incorrect
    On Error Resume Next
    Err.Clear

    ' Ask the document to validate the license token
    doc.Validate (licenseToken)
    If Err Then
        ValidateServer = 0
    Else
        ValidateServer = 1
    End If
End Function
'---------------------------------------
' End Validate Server Function
'---------------------------------------

